package com.service.impl;




import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dao.UserMapper;
import com.model.User;
import com.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * author 张新林
 * 时间 2019/1/20 18:09
 * 描述
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
//    @Autowired
//    private UserMapper userMapper;


    @Override
    public List<User> findUser() {
        return baseMapper.selectList(null);
    }

    @Override
    public List<User> findUserPage(int pageNum, int pageSize) {
        Page<User> page = new Page<User>(pageNum,pageSize);
//        Wrapper wrapper = new EntityWrapper<User>().eq("name", 1);//条件查询
       IPage<User> userlist = baseMapper.selectPage(page, null);

        return userlist.getRecords();
    }
}
